<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.w3.org/1999/xhtml"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns="http://www.w3.org/1999/xhtml">

  <xs:annotation>
    <xs:documentation>
      This is the XML Schema Basic Forms module for XHTML
      $Id: xhtml-basic-form-1.xsd,v 1.1 2003/12/17 03:09:17 ahby Exp $
    </xs:documentation>
    <xs:documentation source="xhtml-copyright-1.xsd"/>
  </xs:annotation>

  <xs:annotation>
    <xs:documentation>    
      Basic Forms

      This forms module is based on the HTML 3.2 forms model, with
      the WAI-requested addition of the label element. While this 
      module essentially mimics the content model and attributes of 
      HTML 3.2 forms, the element types declared herein also include
      all HTML 4 common attributes.

      Elements defined here:

        * form, label, input, select, option, textarea
    </xs:documentation>
    <xs:documentation source="xhtml-copyright-1.xsd"/>
    <xs:documentation 
         source="http://www.w3.org/TR/2001/REC-xhtml-modularization-20010410/abstract_modules.html#s_sformsmodule"/>
  </xs:annotation>

  <xs:attributeGroup name="form.attlist">
    <xs:attributeGroup ref="Common.attrib"/>
    <xs:attribute name="action" type="URI" use="required"/>
    <xs:attribute name="method" use="optional" default="get">
      <xs:simpleType>
        <xs:restriction base="xs:NMTOKEN">
          <xs:enumeration value="get"/>
          <xs:enumeration value="post"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="enctype" type="ContentType" default="application/x-www-form-urlencoded"/>
  </xs:attributeGroup>
  
  <xs:group name="form.content">
    <xs:sequence>
      <xs:group ref="BlkNoForm.mix" minOccurs="1" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:group>

  <xs:complexType name="form.type">
    <xs:group ref="form.content"/>
    <xs:attributeGroup ref="form.attlist"/>
  </xs:complexType>

  <xs:element name="form" type="form.type"/>

  <xs:group name="label.content">
    <xs:sequence>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="input"/>
        <xs:element ref="select"/>
        <xs:element ref="textarea"/>
        <xs:group ref="InlStruct.class"/>
        <xs:group ref="InlPhras.class"/>
        <xs:group ref="I18n.class"/>
        <xs:group ref="InlPres.class"/>
        <xs:group ref="InlSpecial.class"/>
        <xs:group ref="Misc.class"/>
      </xs:choice>
    </xs:sequence>
  </xs:group>

  <xs:attributeGroup name="label.attlist">
    <xs:attributeGroup ref="Common.attrib"/>
    <xs:attribute name="for" type="xs:IDREF"/>
    <xs:attribute name="accesskey" type="Character"/>
  </xs:attributeGroup>

  <xs:complexType name="label.type" mixed="true">
    <xs:group ref="label.content"/>
    <xs:attributeGroup ref="label.attlist"/>
  </xs:complexType>

  <xs:element name="label" type="label.type"/>

<!-- 
Basic Forms removes button, 'image' and 'file' input types.
-->
  <xs:simpleType name="InputType.class">
      <xs:restriction base="xs:NMTOKEN">
        <xs:enumeration value="text"/>
        <xs:enumeration value="password"/>
        <xs:enumeration value="checkbox"/>
        <xs:enumeration value="radio"/>
        <xs:enumeration value="submit"/>
        <xs:enumeration value="reset"/>
        <xs:enumeration value="hidden"/>
      </xs:restriction>
  </xs:simpleType>

  <xs:attributeGroup name="input.attlist">
    <xs:attributeGroup ref="Common.attrib"/>
    <xs:attribute name="type" type="InputType.class" default="text"/>    
    <xs:attribute name="name" type="CDATA"/>
    <xs:attribute name="value" type="CDATA"/>
    <xs:attribute name="checked">
      <xs:simpleType>
        <xs:restriction base="xs:NMTOKEN">
          <xs:enumeration value="checked"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="size" type="Number"/>
    <xs:attribute name="maxlength" type="Number"/>
    <xs:attribute name="src" type="URI"/>
    <xs:attribute name="tabindex" type="Number"/>    
    <xs:attribute name="accesskey" type="Character"/>
  </xs:attributeGroup>
  
  <xs:group name="input.content">
     <xs:sequence/>
  </xs:group>    

  <xs:complexType name="input.type">
    <xs:group ref="input.content"/>
    <xs:attributeGroup ref="input.attlist"/>
  </xs:complexType>

  <xs:element name="input" type="input.type"/>

  <xs:attributeGroup name="select.attlist">
    <xs:attributeGroup ref="Common.attrib"/>
    <xs:attribute name="name" type="CDATA"/>
    <xs:attribute name="size" type="Number"/>
    <xs:attribute name="multiple">
      <xs:simpleType>
        <xs:restriction base="xs:NMTOKEN">
          <xs:enumeration value="multiple"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="tabindex" type="Number"/>    
  </xs:attributeGroup>
  
  <xs:group name="select.content">
    <xs:sequence>
       <xs:element ref="option" maxOccurs="unbounded"/>
    </xs:sequence>  
  </xs:group>       

  <xs:complexType name="select.type">
    <xs:group ref="select.content"/>
    <xs:attributeGroup ref="select.attlist"/>
  </xs:complexType>

  <xs:element name="select" type="select.type"/>

  <xs:attributeGroup name="option.attlist">
    <xs:attributeGroup ref="Common.attrib"/>
    <xs:attribute name="selected">
      <xs:simpleType>
        <xs:restriction base="xs:NMTOKEN">
          <xs:enumeration value="selected"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>    
    <xs:attribute name="value" type="CDATA"/>
    <xs:attribute name="tabindex" type="Number"/>    
  </xs:attributeGroup>
  
  <xs:group name="option.content">
     <xs:sequence/>
  </xs:group>  
  
  <xs:complexType name="option.type" mixed="true">
    <xs:group ref="option.content"/>
    <xs:attributeGroup ref="option.attlist"/>
  </xs:complexType>

  <xs:element name="option" type="option.type"/>

  <xs:attributeGroup name="textarea.attlist">
    <xs:attributeGroup ref="Common.attrib"/>
    <xs:attribute name="name" type="CDATA"/>
    <xs:attribute name="rows" type="Number" use="required"/>
    <xs:attribute name="cols" type="Number" use="required"/>
    <xs:attribute name="accesskey" type="Character"/>
  </xs:attributeGroup>
  
  <xs:group name="textarea.content">
     <xs:sequence/>
  </xs:group>    

  <xs:complexType name="textarea.type" mixed="true">
     <xs:group ref="textarea.content"/>  
     <xs:attributeGroup ref="textarea.attlist"/>
  </xs:complexType>

  <xs:element name="textarea" type="textarea.type"/>

</xs:schema>
